using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PACKETPARSERMAX20.CORE
{
	public class player_xp_for_level : MangosBase
	{
		public System.UInt32? lvl;
		public System.UInt32? xp_for_next_level;




		public override string GetInsertCommand()
		{
			return string.Format("INSERT IGNORE INTO `player_xp_for_level` (`lvl`, `xp_for_next_level`) VALUES ('{0}', '{1}');", lvl.GetValueOrDefault(), xp_for_next_level.GetValueOrDefault());
		}


		public override string GetUpdateCommand()
		{
            StringBuilder sb = new StringBuilder();
						sb.Append("UPDATE `player_xp_for_level` SET ");
			if(xp_for_next_level != null)
			{
				sb.AppendLine("`xp_for_next_level`='" + xp_for_next_level.Value.ToString() + "'");
			}
				sb = sb.Replace("\r\n", ", ");
				sb.Append(" WHERE `lvl`='" + lvl.Value.ToString() + "';");
				sb = sb.Replace(",  WHERE", " WHERE");

            return sb.ToString();
		}


	}
}
